﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;

namespace GosWeb.Models.Db
{
    public class Gene
    {
        private string code;
        public Gene()
        {
        }

        public Gene(string code, string name)
        {
            Code = code;
            Name = name;
        }

        [Key]
        [Display(Name = "代码")]
        [StringLength(2)]
        [Required(ErrorMessage = "必填", AllowEmptyStrings = false)]
        public string Code
        {
            get
            {
                return code;
            }
            set
            {
                code = value.Trim();
            }
        }

        [Display(Name = "品名")]
        [Required(ErrorMessage = "Name is required", AllowEmptyStrings = false)]
        [StringLength(20)]
        public string Name { get; set; }

        /// <summary>
        /// 暂时不支持
        /// </summary>
        [Display(Name = "禁用")]
        public bool? Disable { get; set; }

        [Display(Name = "备注")]
        [StringLength(5000)]
        [DataType(DataType.MultilineText)]
        public string Description { get; set; }
    }
}
